package com.kgc.ljp;

    public class InitThreadDemo {
        public static void main(String[] args) {
            //方法1
            Thread t1 = new Thread(){
                public void run(){
                }
            };
            t1.start();
            //方法2
            Thread t2 = new Thread(new Runnable(){
                public void run(){
                    Thread t = Thread.currentThread();
                    System.out.println(t.getId()+","+t.getName());
                    System.out.println("hi");
                }
            });
            t2.start();
            //方法3
            Thread t3 = new Thread(){
                public void run() {
                    System.out.println("Hi ,t3");
                }
            };
            t3.start();
            //方法4
            new Thread(){
                public void run() {};
            }.start();
            //方法5
            Koo k = new Koo();
            k.start();
        }
    }
    //方法5的一部分
    class Koo extends Thread{
        public void run() {
        }
    }
